package utils;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Random;

import org.apache.commons.io.FilenameUtils;

public class MyUtils {

	private static Random r = new Random(System.currentTimeMillis());
	
	public static  File[] getAllFiles(String dirPath, FilenameFilter filter) {		
		File folder = new File(dirPath);
		File[] listOfFiles = folder.listFiles(filter);
		return listOfFiles;
	}
	
	public static String addStringBFExt(String file, String add){
		return FilenameUtils.getBaseName(file) + add + "." + FilenameUtils.getExtension(file);
	}
	
	public static Random getRandGen(){
		return r;
	}
}
